package com.acme.bankapp.domain.bank;

public class Bank {
	private final int MAX_CLIENTS = 10;
	
	public int getMaxClients() {
		return MAX_CLIENTS;
	}

	private Client[] clients = new Client[MAX_CLIENTS];
	
	private int clientCount = 0;
	
	public int getClientCount() {
		return clientCount;
	}
	
	public void incClientCount() {
		this.clientCount++;
	}
	
	public void addClient(Client client) {
		if(this.clientCount >= 0 && this.clientCount < 10) {
			this.clients[this.clientCount] = client;
			this.incClientCount();
		} else {
			System.out.println("Too many clients");
		}
	}
	
	public Client getClientById(int id) {
		if(this.getClientCount() > id && id >= 0) {
			return clients[id];
		} else {
			return null;
		}
	}

}
